﻿namespace MetaSharp.Transformation
{
    public interface IMatch
    {
        IImmutableArray<Error> Errors { get; }
        IScope End { get; }
        IScope Start { get; }
        object Value { get; }
        bool Matched { get; }
        bool IsLR { get; }

        IMatch AddErrors(params Error[] errors);
        IMatch AddErrors(IImmutableArray<Error> errors);
        IMatch AddVariable(string name, object value);
        IMatch AddVariables(Map<string, object> variables);
        IMatch SetEnd(IScope scope);
        IMatch SetValue(object value);
        IMatch PopRule();

        IScope Step();

        SourceSpan Trace();
    }
}
